package com.fc.tms.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fc.framework.entity.BaseEntity;
import com.fc.tms.constant.UserType;

@Entity
@Table(name = "s_user")
public class User extends BaseEntity {

    private static final long serialVersionUID = -7185160904833033026L;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "e_name")
    private String eName;

    @Column(name = "cn_name")
    private String cnName;

    @Column(name = "pinyin_name")
    private String pinyinName;

    @Column(name = "mobile")
    private String mobile;

    @Column(name = "mail")
    private String mail;

    @Column(name = "user_type")
    @Enumerated(EnumType.STRING)
    private UserType userType;

    @Column(name = "is_dimission")
    private Boolean isDimission = Boolean.FALSE;

    public Boolean getIsDimission() {
        return isDimission;
    }

    public void setIsDimission(Boolean isDimission) {
        this.isDimission = isDimission;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
    private List<TrainingLog> trainingLogs;

    public String getCnName() {
        return cnName;
    }

    public String geteName() {
        return eName;
    }

    public Long getId() {
        return id;
    }

    public String getMail() {
        return mail;
    }

    public String getMobile() {
        return mobile;
    }

    public String getPinyinName() {
        return pinyinName;
    }

    public UserType getUserType() {
        return userType;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public void seteName(String eName) {
        this.eName = eName;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public void setPinyinName(String pinyinName) {
        this.pinyinName = pinyinName;
    }

    public void setUserType(UserType userType) {
        this.userType = userType;
    }
}